﻿using GalaSoft.MvvmLight;
using System;
using GalaSoft.MvvmLight.Messaging;
using SGTLightAccent.Models;

namespace SGTLightAccent.ViewModel
{
    /// <summary>
    /// This class contains properties that a View can data bind to.
    /// <para>
    /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
    /// </para>
    /// <para>
    /// You can also use Blend to data bind with the tool's support.
    /// </para>
    /// <para>
    /// See http://www.galasoft.ch/mvvm/getstarted
    /// </para>
    /// </summary>
    public class NavegacionViewModel : ViewModelBase
    {
        /// <summary>
        /// Initializes a new instance of the NavegacionViewModel class.
        /// </summary>
        private Uri _ContenidoPagina;
        private Messenger _mensajero = Messenger.Default;


        public Uri ContenidoPagina
        {
            get { return _ContenidoPagina; }
            set
            {
                _ContenidoPagina = value;
                RaisePropertyChanged("ContenidoPagina");
            }
        }

        public NavegacionViewModel()
        {
            if (IsInDesignMode)
            {
                ////    // Code runs in Blend --> create design time data.
            }
            else
            {
             
                ContenidoPagina = new Uri("/Views/Home.xaml", UriKind.Relative);
                Messenger.Default.Register<EnvioMensaje>(this, msg => procesarMensaje(msg));
               

            }
        }

        private void procesarMensaje(EnvioMensaje msg)
        {
            //ContenidoPagina = new Uri("/Views/Remitos.xaml", UriKind.Relative);

            


        }

        ////public override void Cleanup()
        ////{
        ////    // Clean own resources if needed

        ////    base.Cleanup();
        ////}
    }
}